#!/usr/bin/env python2.5
# encoding: utf-8

if not globals().has_key("esda"):
    execfile("esda.py")
    sys.exit()

init()

import random, time

startTime = time.time()
scale     = 60
number    = 3000

for i in range(2):
    name = "Stream%d"%i
    
    newStream(name)
    
    value = 1
    for i in range(0, number * scale, scale):
        value += random.random() - 0.499
        streams[name][startTime + i:startTime + i + scale] = value

newOperatorStream(
    'ProductOfStream1AndStream0Slow',
    'Stream1', 'Stream0',
    lambda value1, value2: value1 * value2)

duplicateStream(
    'ProductOfStream1AndStream0Slow',
    'ProductOfStream1AndStream0')

show(0)
show(1)
show(3)
